/*
 * Created on 01/05/2008
 */
package com.apbetioli.mapr.util.properties;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Adapted from:
 * http://www.guj.com.br/posts/list/35919.java
 * 
 * @author Alexandre Parra Betioli 
 */
public class PropertiesLoader {

    private Properties props;

    protected PropertiesLoader( final String propertiesFileName ) {
        props = new Properties();
        InputStream in = this.getClass().getResourceAsStream(propertiesFileName);
        try {
            props.load(in);
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    protected String getValue( final String key ) {
        return (String) props.getProperty(key);
    }
}  
